load("@com_github_p4lang_p4c//:bazel/p4_library.bzl", "p4_library", "p4_graphs")

p4_library(
  name = "program",
  src = "program.p4",
  deps = ["empty.p4"],
  p4info_out = "program.p4info.txt",
  visibility = ["//:__subpackages__"],
)

p4_library(
  name = "program_with_more_options",
  src = "program.p4",
  deps = ["empty.p4"],                  # Optional: #include-ed dependencies.
  p4info_out = "program.p4info.2.txt",  # Optional.
  target = "bmv2",                      # Optional (default: "bmv2").
  target_out = "program.bmv2.json",     # Optional.
  arch = "v1model",                     # Optional (default: "v1model").
  visibility = ["//:__subpackages__"],  # Optional.
)

p4_library(
  name = "vxlan_dpdk_pna",
  src = "vxlan.p4",
  p4c_backend = "@com_github_p4lang_p4c//:p4c_dpdk",
  arch = "pna",
  target = "dpdk",
  context_out = "vxlan.context",
  bf_rt_schema_out = "vxlan.bf-rt-schema",
  target_out = "vxlan.spec",
)

p4_graphs(
  name = "program_graphs",
  src = "program.p4",
  deps = ["empty.p4"],
  out = "program_graphs.dot",
)
